# -*- coding: utf-8 -*-
#!/usr/bin/env python3

import socket

IP = '127.0.0.1'
PORT = 8888

def server():
    s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
    s.bind((IP, PORT))
    # 数据处理
    while True:
        data, addr = s.recvfrom(1024)
        print('来自 ', addr, ' 的数据: ', data.decode('utf-8'))
        s.close()


server()
